#ifndef VBO_MODEL_H
#define VBO_MODEL_H

#include <string>
#include "dataInModelConstants.h"
#include "resource.h"

//! Enkapsuluje model3D zapisany w formacie przyjaznym dla VBO
class VBOModel : public Resource
{
 friend class MeshManager;

 typedef unsigned int uint;

 public:
	
	uint GetVBOid( uint ith )	const
	{ return VBOids[ ith ]; }

	string GetName( uint ith )	const
	{ return names[ ith ]; }

	uint GetNumberOfVertices( uint ith )	const
	{ return numberOfVertices[ith ]; }

	uint GetNumberOfElements()	const
	{ return numberOfElements; }

	DataInModel GetDataType()	const
	{ return dataInModel; }

	int GetPolygonType()	const
	{ return polygonType; }

	~VBOModel()
	{
		delete[] VBOids;
		delete[] names;
		delete[] numberOfVertices;
	}

 private:

	int polygonType;
	uint* VBOids;
	string* names;
	uint* numberOfVertices;
	uint numberOfElements;
	DataInModel dataInModel;

	VBOModel() : VBOids( NULL ), names( NULL ), numberOfVertices( NULL ), numberOfElements( 0 )
	{}

	VBOModel( string path_, string name_, int polygonType_, uint numberOfElements_, DataInModel dataInModel_ )
		:	Resource( path_, name_ ), polygonType(polygonType_), numberOfElements(numberOfElements_), dataInModel(dataInModel_) 
	{
		VBOids = new uint[ numberOfElements ];
		names = new string[ numberOfElements ];
		numberOfVertices = new uint[ numberOfElements ];
	}

};

#endif